import Vue from 'vue'
// 1、引入vueRouter
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

// 2、使用vueRouter
Vue.use(VueRouter)

// 懒加载实现
// const Home = () => import('../views/Home')
const Data = () => import('../views/Data')
const Product = () => import('../views/Product')
const Solutions = () => import('../views/Solutions')
const Service = () => import('../views/Serivce')
const About = () => import('../views/About')
// 3、单独写， 便于修改
const routes = [
  // 没有懒加载
  {
    path: '/home',
    component: Data
  },
  {
    path: '/data',
    component: Data
  },
  {
    path: '/product',
    component: Product
  },
  {
    path: '/solutions',
    component: Solutions
  },
  {
    path: '/service',
    component: Service
  },
  {
    path: '/about',
    component: About
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
